const urlReg = /^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
const urlStr1 = 'https://haha.sunshine.com/xxx/xxx';
console.log(urlReg.test(urlStr1));
const urlStr2 = 'sss://haha.sunshine.com/xxx/xxx';
console.log(urlReg.test(urlStr2));
const urlStr3 = 'http://haha.sunshine.com/xxx/xxx';
console.log(urlReg.test(urlStr3));